<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>作业1</title>
</head>
<body>
<h1><pre>
import time

class Person:
    def __init__(self, name, age):
        self.name = name
        self.age = age

    def speak(self):
        print("我是%s，今年%d岁了。" % (self.name, self.age))

class Student(Person):
    def __init__(self, name, age, school, id):
        super(Student, self).__init__(name, age)
        self.school = school
        self.my_id = id

    def speak(self):
        print("我是%s，今年%d岁了。我来自%s，学号是%s" % (self.name, self.age, self.school, self.my_id))

    def run(self, v, times):
        print("我是%s，我跑步的距离是%f米" %(self.name, v*times))

class CollegeStudent(Student):
    def __init__(self, name, age, school, id, language):
        super(CollegeStudent, self).__init__(name, age, school, id)
        self.language = language

    def speak(self):
        print("我是%s，今年%d岁了。我来自%s，学号是%s,我的母语是%s" % (self.name, self.age, self.school, self.my_id, self.language))

    def coding(self):
        print("I am coding", end=" ")
        for i in range(10):
            print(".", end=" ")
            time.sleep(1)
        print("")

a = Student("张三", 18, "西安理工大学", "001")
a.speak()
a.run(20,30)
b = CollegeStudent("李四", 20, "西安理工大学", "002", "汉语")
b.speak()
b.coding()
b.run(1,20)
</pre></h1>
</body>
</html>